USE [texchange_db]
GO

/****** Object:  UserDefinedFunction [dbo].[Fn_GetUserByEmail]    Script Date: 05/29/2011 20:00:30 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE function [dbo].[Fn_GetUserByEmail] 
(
  @email nvarchar(50)
)
RETURNS TABLE 
AS
RETURN 
(
	 SELECT TOP 1
   		 [id], [Name], [username],[password],[isActive],[lastLogin]
  FROM [dbo].[Users]
  WHERE [username]=@email
  )



GO


